<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<body>
<h1>添加用户</h1>
<div id="addUser">
    <input type="text" id="userName" name="userName" placeholder="用户名"><br>
    <input type="text" id="userAccount" name="userAccount" placeholder="账号"><br>
    <input type="password" id="userPassword" name="userPassword" placeholder="密码"><br>
    <input type="text" id="phone" name="phone" placeholder="电话"><br>
    <input type="text" id="email" name="email" placeholder="邮箱"><br>
    <input type="button" id="add" value="添加" @click="addUser">
</div>
</body>
<script>
    var app = new Vue({
        el: "#addUser",
        methods: {
            addUser: function () {
                let data = new FormData();
                data.append("userName", $("#userName").val());
                data.append("userAccount", $("#userAccount").val());
                data.append("userPassword", $("#userPassword").val());
                data.append("phone", $("#phone").val());
                data.append("email", $("#email").val());
                axios.post("http://localhost:9999/user/addUser", data).then(function (response) {
                    console.log(response.data)
                }), function (err) {
                    console.log(err)
                }
            }
        }
    })
</script>
</html>